@extends('backstage.layout.master')
@section('title', '用户信息')
@section('content')
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try {
                ace.settings.check('breadcrumbs', 'fixed')
            } catch (e) {
            }
        </script>

        <ul class="breadcrumb">
            <li>
                <i class="icon-home home-icon"></i>
                <a href="backstage/home">主页</a>
            </li>

            <li class="active">
                <a href="backstage/user/userlist">用户列表</a>
            </li>
        </ul><!-- .breadcrumb -->

        <div class="nav-search" id="nav-search">
            <form class="form-search">

            </form>
        </div><!-- #nav-search -->
    </div>

    <div class="page-content">
        <div class="page-header">
            <h1>
                {{ $users->name }}的详情
            </h1>
        </div>
        <div class="row" style="margin-top: 50px;">
            <!-- PAGE CONTENT BEGINS -->
            <div class="col-md-2 col-xs-12" style="margin-left:17%">
            <span class="profile-picture">
                <img id="avatar" class="editable img-responsive editable-click editable-empty"
                     style="width: 170px;height:170px; "
                     src="{{$users->iconUrl}}">
			</span>
            </div>
            <form class="form-horizontal" role="form" action="" method="post" enctype="multipart/form-data">
                <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">

                <div class="col-md-4 col-xs-12" style="margin-left:-2%;">
                    <!-- PAGE CONTENT BEGINS -->
                    <div class="profile-user-info profile-user-info-striped">
                        <input type="hidden" value="" class="id">

                        <p name="user_id" style="display:none">{{ $users->user_id}}</p>

                        <div class="profile-info-row">
                            <div class="profile-info-name">id</div>
                            <div class="profile-info-value id">{{ $users->id}}</div>
                        </div>

                        <div class="profile-info-row">
                            <div class="profile-info-name"> 用户名</div>
                            <div class="profile-info-value"><span class="sex-text">{{ $users->name }}</span>
                                <input type="text" value="{{ $users->name }}" name="name" hidden="hidden"
                                       required="required">
                            </div>
                        </div>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> 性别</div>
                            <div class="profile-info-value">
                            <span class="sex-text">@if($users->sex == 0)
                                    未知
                                @elseif($users->sex == 1)
                                    男
                                @elseif($users->sex == 2)
                                    女
                                @endif
                            </span>
                                <div class="sex" hidden="hidden">
                                    @if($users->sex == 0)
                                        <input type="radio" name="sex" value="1"/> 男
                                        <input type="radio" name="sex" value="2"/> 女
                                    @elseif($users->sex == 1)
                                        <input type="radio" name="sex" value="1" checked="checked"/> 男
                                        <input type="radio" name="sex" value="2"/> 女
                                    @elseif($users->sex == 2)
                                        <input type="radio" name="sex" value="1"/> 男
                                        <input type="radio" name="sex" value="2" checked="checked"/> 女
                                    @endif
                                </div>

                            </div>
                        </div>

                        <div class="profile-info-row">
                            <div class="profile-info-name">生日</div>
                            <div class="profile-info-value">
                                <span class="birth-text">
                                    @if($users->birthday =='')
                                        未填写
                                    @elseif($users->birthday !='')
                                        {{ $users->birthday }}
                                    @endif
                                </span>
                                <input type="text" value="{{ $users->birthday }}" name="birthday" hidden="hidden">
                            </div>
                        </div>

                        <div class="profile-info-row">
                            <div class="profile-info-name">E-mail</div>
                            <div class="profile-info-value">
                            <span class="email-text">
                            @if($users->email =='')
                                    未填写
                                @elseif($users->email !='')
                                    {{ $users->email }}
                                @endif
                            </span>
                                <input type="text" value="{{ $users->email }}" name="email" hidden="hidden">
                            </div>
                        </div>

                        <div class="profile-info-row">
                            <div class="profile-info-name"> 手机号码</div>
                            <div class="profile-info-value ">
                            <span class="phone-text">
                                @if($users->phone =='')
                                    未填写
                                @elseif($users->phone !='')
                                    {{ $users->phone }}
                                @endif
                            </span>
                                <input type="text" value="{{ $users->phone }}" name="phone" hidden="hidden"
                                       required="required">
                            </div>
                        </div>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> 个性签名</div>
                            <div class="profile-info-value ">
                            <span class="signature-text">
                                @if($users->signature =='')
                                    未填写
                                @elseif($users->signature !='')
                                    {{ $users->signature }}
                                @endif
                            </span>
                                <input type="text" value="{{ $users->signature }}" name="signature" hidden="hidden">
                            </div>
                        </div>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> 登录方式</div>
                            <div class="profile-info-value">
                                @if ($users->login_type === 0)
                                    帐号登录
                                @elseif ($users->login_type == 1)
                                    QQ登录
                                @elseif ($users->login_type == 2)
                                    微信登录
                                @elseif ($users->login_type == 3)
                                    新浪微博登录
                                @endif
                            </div>
                        </div>
                        <div class="profile-info-row">
                            <div class="profile-info-name"> 创建时间</div>
                            <div class="profile-info-value">{{ date('Y-m-d H:i:s',$users->created_at) }}</div>
                        </div>
                    </div>

                    <div class="btn-groud " style="margin-top:10px;padding-right: 2%;">
                        <input type="submit" class="btn btn-success done"
                               style="float: right;display: none;margin-left: 10px;" value="完成">
                        <input type="reset" class="btn reset" style="float: right;display: none;" value="重置">
                        <input type="button" class="btn btn-primary update" style="float: right" value="修改">
                    </div>
                    <!-- PAGE CONTENT ENDS -->
                </div><!-- /.col -->
            </form>
            <!-- PAGE CONTENT ENDS -->
        </div><!-- /.col -->
    </div><!-- /.row -->
    </div><!-- /.page-content -->
@stop
@section('script')
    <script type="text/javascript">
        $(function () {
            $(".update").click(function () {
                $('.name-text').hide();
                $('.sex-text').hide();
                $('.email-text').hide();
                $('.phone-text').hide();
                $('.signature-text').hide();
                $('.birth-text').hide();
                $(".done").show();
                $("input").show();
                $(".sex").show();
                $(".signature").show();
                $(".update").hide();
            });
        });
    </script>
@stop